<?php

namespace App\Http\Admin\Controllers\Mate;

use App\Http\Admin\Services\Config\ConfigService;
use App\Http\Admin\Services\Mate\MateService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;


class MateController extends Controller
{
    protected $service;
    public function __construct(MateService $mateService)
    {
        $this->service = $mateService;
    }
    /*
   * 材料生产页面
   * */
    public function index(){
        return view('mate.index');
    }

    /*
     * 列表
     * */
    public function list(Request $request)
    {
        $conditions = $request->all() ?? '';

        $result = $this->service->list($conditions);

        return res('list',$result);
    }

    /*
     * 好文
     * */
    public function getWords(Request $request)
    {
        $conditions = $request->all() ?? '';

        $result = $this->service->getWords($conditions);

        return res('words',$result);
    }




}